<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<!-- 页面头部【start】 -->
	<head>
	<link href="<%=basePath%>images/favicon1.ico" rel="Shortcut Icon"/>
		<link rel="Bookmark" href="<%=basePath%>images/favicon1.ico"/>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta name="keywords" content="瑞中瑞 R&R" />
		<meta name="description" content="瑞中瑞 R&R" />
		<link rel="stylesheet" type="text/css" href="<%=basePath%>/share/css/style.css" />
		<script type="text/javascript" language="javascript"
			src="<%=basePath%>/share/js/jquery-1.4.3.min.js"></script>
		<script type="text/javascript" language="javascript"
			src="<%=basePath%>/share/js/droppy.js"></script>
		<script type="text/javascript" language="javascript"
			src="<%=basePath%>/share/js/thickbox.js"></script>
		<script type="text/javascript" language="javascript"
			src="<%=basePath%>/share/js/helper.js"></script>
		<script type="text/javascript" language="javascript"
			src="<%=basePath%>/share/js/png.js"></script>
		<link rel="stylesheet" type="text/css"
			href="<%=basePath%>/share/css/thickbox.css" />
		<link rel="stylesheet" type="text/css"
			href="<%=basePath%>/share/css/jquery.ui.core.css" />
		<link rel="stylesheet" type="text/css"
			href="<%=basePath%>/share/css/jquery.ui.dialog.css" />
		<link rel="stylesheet" type="text/css"
			href="<%=basePath%>/share/css/jquery.ui.theme.css" />
		<link rel="stylesheet" type="text/css"
			href="<%=basePath%>/share/css/jquery.ui.resizable.css" />		
		<script type="text/javascript">
		function saveMesg() { 
			var url = 'FeedBackMesg.action';
			var params = {
				nickname:$('#mess_username_').val(),
				email:$('#mess_email_').val(),
				phone:$('#mess_tele_').val(),
				content:$('#mess_message_').val(),
				code:$('#mess_rand_rs_').val()
			};
			$.ajax({				
				url:'FeedBackMesg.action',
				type:"POST",
				data: {fbJsonString:JSON.stringify(params)},
				dataType:"string",
				success:function(info){
					$("#messfrm_stat").css({"display":"none"});
					if("0"==info){
						alert($("#error8").val());
					}else if("1"==info){
						$('#mess_username_').val("");
						$('#mess_email_').val("");
						$('#mess_tele_').val("");
						$('#mess_message_').val("");
						$('#mess_rand_rs_').val("");
						loadImg();
						alert($("#error9").val());
					}else{
						alert($("#error10").val());
					}
				}
			});
		}
        </script>
		
		<title><s:property value="%{getText('Navigation6')}"/> -- <s:property value="%{getText('Company_Title')}"/></title>
		<script type="text/javascript">
			function loadImg() {
			 var piccode = document.getElementById('piccode');
			 piccode.src = '/rmrltd/member/image.action?str='+new Date().toString();//需要加不能的参数，若不加，请求不到的
			}			
		</script>
	</head>
	<!--  页面头部【end】 -->
	<body class="body1">
		<div id="getValues" value="form" style="display: none;"></div>
		<div id="getParams" value="a:2:{s:2:&quot;_m&quot;;s:11:&quot;mod_message&quot;;s:2:&quot;_a&quot;;s:4:&quot;form&quot;;}"
			style="display: none;"></div>
		<div id="main_div">
			<div id="top">
				<jsp:include page="/share/jsp/head.jsp"></jsp:include>
				<jsp:include page="/share/jsp/navigation_bar.jsp"></jsp:include>
			</div>
			<div class="web_bg">
				<div id="mainmain">
					<div id="main_con">
						<div class="web_bg">
							<div id="left2">
								<jsp:include page="/share/jsp/banner.jsp"></jsp:include>
								<div class="art_list1">
									<!-- 编辑时动态触发 【start】-->
									<!--
									<div class="mod_toolbar" id="tb_mb_message1" style="display: none; height: 28px; position: absolute; right: 2px; background: none repeat scroll 0% 0% rgb(247, 182, 75); width: 70px;">
										<a onclick="popup_window('admin/index.php?_m=mod_message&_a=admin_list','&nbsp;&nbsp;',false,false,true);return false;" title="" href="#"><img border="0" alt="" src="images/edit_content.gif">&nbsp;</a>
									</div>
									-->
									<!-- 编辑时动态触发 【end】-->
									<div class="art_list_title">
										<s:property value="%{getText('Navigation6')}"/>
									</div>
									<span id="messfrm_stat" class="status" style="display: none;"></span>
									<form name="messform" id="messform"										
										action="FeedBack.action"
										method="post">
										<input type="hidden" name="_m" id="_m" value="mod_message" />
										<input type="hidden" name="_a" id="_a" value="messInsert" />
										<input type="hidden" name="_r" id="_r" value="_ajax"/>
											<!--mess_main-->
											<div id="mess_main">
												<div class="mess_list">
													<div class="mess_title">
														<s:property value="%{getText('FeedBack_Nickname')}"/>
													</div>
													<div class="mess_input">
														<input type="text" name="fb.nickname"
															id="mess_username_" value=""/>
													</div>
												</div>
												<div class="mess_list">
													<div class="mess_title">
														<s:property value="%{getText('FeedBack_Email')}"/>
													</div>
													<div class="mess_input">
														<input type="text" name="fb.email" id="mess_email_"
															value=""/>
													</div>
												</div>
												<div class="mess_list">
													<div class="mess_title">
														<s:property value="%{getText('FeedBack_Tel')}"/>
													</div>
													<div class="mess_input">
														<input type="text" name="fb.phone" id="mess_tele_"
															value=""/>
													</div>
												</div>
												<div class="mess_list">
													<div class="mess_title">
														<s:property value="%{getText('FeedBack_Text')}"/>
													</div>
													<div class="mess_textarea">
														<textarea name="fb.content" id="mess_message_" rows="6"
															cols="36"></textarea>
													</div>
												</div>
												<div class="mess_list">
													<div class="mess_title">
														<s:property value="%{getText('FeedBack_Code')}"/>
													</div>
													<div class="mess_input">
														<img id="piccode" src="/rmrltd/member/image.action"  align='absmiddle' border='0' onclick="loadImg()" alt="<s:property value="%{getText('Code')}"/>" title="<s:property value="%{getText('Code')}"/>"/>
														<input type="text" name="fb.code"
															id="mess_rand_rs_" value="" style="width: 52px;"/>
													</div>
												</div>
												<div class="mess_list">
													<div class="mess_submit">
														<input name="sub" type="button" onclick="return check_mess_info('messform');" class="subd" value="<s:property value="%{getText('Submit')}"/>"/>
													</div>
												</div>
												<div class="message_bg"></div>
												
											</div>
											<!--mess_main end-->
											<img alt="" src="<%=basePath%>share/images/bag_30.jpg">	
											<input type="hidden" name="error1" id="error1" value="<s:property value="%{getText('FeedBack_Error1')}"/>" />
											<input type="hidden" name="error2" id="error2" value="<s:property value="%{getText('FeedBack_Error2')}"/>" />
											<input type="hidden" name="error3" id="error3" value="<s:property value="%{getText('FeedBack_Error3')}"/>" />
											<input type="hidden" name="error4" id="error4" value="<s:property value="%{getText('FeedBack_Error4')}"/>" />
											<input type="hidden" name="error5" id="error5" value="<s:property value="%{getText('FeedBack_Error5')}"/>" />
											<input type="hidden" name="error6" id="error6" value="<s:property value="%{getText('FeedBack_Error6')}"/>" />
											<input type="hidden" name="error7" id="error7" value="<s:property value="%{getText('FeedBack_Error7')}"/>" />
											<input type="hidden" name="error8" id="error8" value="<s:property value="%{getText('FeedBack_Error8')}"/>" />
											<input type="hidden" name="error9" id="error9" value="<s:property value="%{getText('FeedBack_Error9')}"/>" />
											<input type="hidden" name="error10" id="error10" value="<s:property value="%{getText('FeedBack_Error10')}"/>" />
									</form>
								</div>

								<script type="text/javascript" language="javascript">
								<!--
								function check_mess_info(thisForm)
								{									
								if (/^\s*$/.test($("#mess_username_").val()))
								{
									alert($("#error1").val());									
									$("#mess_username_").focus();
									return false;
								}
								if (/^\s*$/.test($("#mess_email_").val()))
								{
									alert($("#error2").val());
									$("#mess_email_").focus();
									return false;
								}else{
									if(!isValidMail($("#mess_email_").val())){
										alert($("#error3").val());
										$("#mess_email_").focus();
										return false;
									}
								}
								if (/^\s*$/.test($("#mess_tele_").val()))
								{
									alert($("#error4").val());
									$("#mess_tele_").focus();
									return false;
								}else{
									var reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/; 
									if(!reg.test($("#mess_tele_").val())){
										var reg2 =/^0{0,1}(13[0-9]|15[0-9])[0-9]{8}$/;
										if(!reg2.test($("#mess_tele_").val())){
											alert($("#error5").val());
											$("#mess_tele_").focus();
											return false;
										}
									}
								}
								if (/^\s*$/.test($("#mess_message_").val()))
								{
									alert($("#error6").val());
									$("#mess_message_").focus();
									return false;
								}
								if (/^\s*$/.test($("#mess_rand_rs_").val()))
								{
									alert($("#error7").val());
									$("#mess_rand_rs_").focus();
									return false;
								}
								$("#messfrm_stat").css({"display":"block"});
								$("#messfrm_stat").html("Saving message...");								
								saveMesg();								
								return true;
								}
								function isValidMail(sText) {
									 var reMail = /^(?:[a-z\d]+[_\-\+\.]?)*[a-z\d]+@(?:([a-z\d]+\-?)*[a-z\d]+\.)+([a-z]{2,})+$/i;
									 return reMail.test(sText);
								}
								-->
								</script>
							</div>
							<div id="right">
								<jsp:include page="/share/jsp/latest_articles.jsp"></jsp:include>
								<jsp:include page="/share/jsp/links.jsp"></jsp:include>
							</div>
							<div class="blankbar"></div>
						</div>
					</div>
				</div>
			</div>
			<!-- 页脚【start】 -->
			<jsp:include page="/share/jsp/tail.jsp"></jsp:include>
			<!-- 页脚【end】 -->
		</div>
	</body>	
</html>